package org.xlx.xlx_oa.warehouse.api;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.*;
import org.xlx.xlx_oa.common.ResponseBean;
import org.xlx.xlx_oa.role_user.domain.vo.AuditVo;
import org.xlx.xlx_oa.warehouse.domain.vo.WarehouseApplyVo;

@ApiImplicitParams(value = {
        @ApiImplicitParam(name = "x-request-id", value = "${clientTraceId}",
                paramType = "header", dataType = "String", dataTypeClass = String.class),
        @ApiImplicitParam(name = "Authorization", value = "${BearerToken}",
                paramType = "header", dataType = "String", dataTypeClass = String.class, required = false)
})
@ApiResponses(value = {
        @ApiResponse(code = 400, message = "Bad Request"),
        @ApiResponse(code = 401, message = "Authentication Error"),
        @ApiResponse(code = 403, message = "Authorization Error"),
        @ApiResponse(code = 500, message = "Internal Server Error"),
        @ApiResponse(code = 503, message = "Service Unavailable")
})
public interface WarehouseApplyApi {
    @PostMapping("/save")
    ResponseBean saveApply(@RequestBody WarehouseApplyVo applyVo);

    @PostMapping("/beAudit/list")
    ResponseBean getBeAuditList(@RequestBody WarehouseApplyVo applyVo);

    @PostMapping("/beAudit/count")
    ResponseBean getBeAuditCount(@RequestBody WarehouseApplyVo applyVo);

    @PostMapping("/apply/list")
    ResponseBean getApplyList(@RequestBody WarehouseApplyVo applyVo);

    @PostMapping("/apply/count")
    ResponseBean getApplyCount(@RequestBody WarehouseApplyVo applyVo);

    @PostMapping("/maxCount")
    ResponseBean getMaxCount(
            @RequestParam(value = "facilityId") Long facilityId,
            @RequestParam(value = "type") String type);

    @GetMapping("/detail/{id}")
    ResponseBean getApplyDetail(@PathVariable(value = "id") Long id);

    @PostMapping("/audit")
    ResponseBean audit(@RequestBody AuditVo auditVo);
}
